import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'


export default defineConfig({
  base: '/bigtv/',
  plugins: [vue()],
  resolve: {
    alias: {
      '@': '/src',
    },
  },
  server: {
    host: '0.0.0.0',
    port: 8891,
    // proxy: {
    //   '/api': {
    //     target: 'http://192.168.2.202:8889/api',
    //     ws: true,
    //     changeOrigin: true,
    //   },
    // },
  },
  build: {
    outDir: 'adminDist',
    chunkSizeWarningLimit: 1500,
    rollupOptions: {
      output: {
        entryFileNames: `assets/[name].[hash].js`,
        chunkFileNames: `assets/[name].[hash].js`,
        assetFileNames: `assets/[name].[hash].[ext]`,
        compact: true,
        manualChunks: {
          vue: ['vue', 'vue-router', 'pinia'],
          echarts: ['echarts'],
        },
      },
    },
  },
  css: { preprocessorOptions: { css: { charset: false } } }
})
